import java.io.*;
import java.net.*;


public class udpclient{
	public static void main(String[] args){
		
		DatagramSocket socket = null;
		try{
			InetAddress addr = InetAddress.getByName("127.0.0.1");
			int port = 2345;
			byte[] message = args[0].getBytes();
			DatagramPacket packet = new DatagramPacket(message, message.length, addr, port);

			socket = new DatagramSocket();
			socket.send(packet);
			

			byte[] m =new byte[1000];
			DatagramPacket p = new DatagramPacket(m, m.length);
			socket.receive(p);
			System.out.println("Client receive "+new String(p.getData()));

		} catch(IOException e){
			System.out.println(e.getMessage());
		} finally{
			socket.close();
		}

	}
}